﻿<%@ Control Language="C#" AutoEventWireup="true" Codebehind="UserPermision.ascx.cs"
    Inherits="Portal.Administrator.Users.UserPermision" %>
<%@ Register Assembly="System.Web.Extensions" Namespace="System.Web.UI" TagPrefix="asp" %>
<table border="0" cellpadding="0" cellspacing="1" class="content" width="100%">
    <tr>
        <td class="postheader" width="40%" align="left" valign="top">
            <asp:UpdatePanel ID="upanelUserPermission" runat="server" UpdateMode="Conditional" RenderMode="Inline">
                <Triggers>
                    <asp:AsyncPostBackTrigger controlid="btnUpdate" eventname="Click" />
                    <asp:AsyncPostBackTrigger controlid="btnCancel" eventname="Click" />
                    <asp:AsyncPostBackTrigger controlid="dropPortal" eventname="SelectedIndexChanged" />
                    <asp:AsyncPostBackTrigger controlid="dropUser" eventname="SelectedIndexChanged" />
                </Triggers>
                <ContentTemplate>
                    <table border="0" cellpadding="0" cellspacing="1" class="content" style="width: 100%">
                        <tr>
                            <td class="post" align="left">
                                Cổng&nbsp;:&nbsp;<asp:DropDownList ID="dropPortal" runat="server" DataTextField="Portal_Name" DataValueField="PortalID" AutoPostBack="True" OnSelectedIndexChanged="dropPortal_SelectedIndexChanged" >
                                </asp:DropDownList></td>
                        </tr>
                        <tr>
                            <td class="post" align="left">
                                Tài khoản&nbsp;:&nbsp;<asp:DropDownList ID="dropUser" runat="server" DataTextField="Username" DataValueField="UserID" AutoPostBack="True" OnSelectedIndexChanged="dropUser_SelectedIndexChanged" >
                                </asp:DropDownList></td>
                        </tr>
                        <tr>
                            <td class="post" align="left">                        
                                        <asp:ListBox ID="lstCommands" runat="server" Height="421px" SelectionMode="Multiple" Width="100%" ></asp:ListBox></td>
                        </tr>
                        <tr>
                            <td class="postfooter" align="center">
                                <Button:Update ID="btnUpdate" runat="server" CssClass="pbutton" OnClick="btnUpdate_Click" Text="Cập nhật" />&nbsp;<asp:Button ID="btnCancel" CssClass="pbutton" runat="server" Text="Hủy" OnClick="btnCancel_Click" />
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </asp:UpdatePanel>
        </td>
        <td class="post" width="60%" align="left" valign="top">
            <asp:UpdatePanel ID="upanelUserPermission1" runat="server" UpdateMode="Conditional" RenderMode="Inline">
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnUpdate" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="btnUpdateAll" EventName="Click" />
                <asp:AsyncPostBackTrigger controlid="dropPortal" eventname="SelectedIndexChanged" />
                <asp:AsyncPostBackTrigger controlid="dropUser" eventname="SelectedIndexChanged" />
            </Triggers>
            <ContentTemplate>
                <table border="0" cellpadding="0" cellspacing="1" class="content" style="width: 100%">
                    <tr>
                        <td class="header1" align="left">
                            <asp:Label ID="lblCommandName" runat="server"></asp:Label>
                        </td>
                    </tr>                
                    <tr>                    
                        <td valign="top" class="postheader" align="left">                        
                            <asp:DataGrid ID="dgrUserRole" runat="server" AutoGenerateColumns="False" Width="100%"
                                OnItemCommand="dgrUserRole_ItemCommand" OnItemDataBound="dgrUserRole_ItemDataBound"
                                CellPadding="0" CellSpacing="10" BorderWidth="0" BorderColor="white" >
                                <Columns>
                                    <asp:BoundColumn DataField="UserID" Visible="False" />
                                    <asp:BoundColumn DataField="CommandID" Visible="False" />
                                    <asp:BoundColumn DataField="PortalID" Visible="False" />
                                    <asp:TemplateColumn HeaderText="&nbsp;&nbsp;Command">
                                        <ItemStyle HorizontalAlign="Left" />
                                        <HeaderStyle Width="50%" HorizontalAlign="Left" />
                                        <ItemTemplate>
                                            &nbsp;&nbsp;<asp:Label ID="lblCmdName" runat="server" ></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateColumn>
                                    <asp:TemplateColumn HeaderText="Đọc">
                                        <ItemStyle HorizontalAlign="Center" />
                                        <HeaderStyle Width="10%" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:CheckBox ID="chkView" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateColumn>
                                    <asp:TemplateColumn HeaderText="Ghi">
                                        <ItemStyle HorizontalAlign="Center" />
                                        <HeaderStyle Width="10%" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:CheckBox ID="chkAdd" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateColumn>
                                    <asp:TemplateColumn HeaderText="Sửa">
                                        <ItemStyle HorizontalAlign="Center" />
                                        <HeaderStyle Width="10%" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:CheckBox ID="chkEdit" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateColumn>
                                    <asp:TemplateColumn HeaderText="X&#243;a">
                                        <ItemStyle HorizontalAlign="Center" />
                                        <HeaderStyle Width="10%" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <asp:CheckBox ID="chkDelete" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateColumn>
                                    <asp:TemplateColumn HeaderText="Cập nhật">
                                        <ItemStyle HorizontalAlign="Center" />
                                        <HeaderStyle Width="10%" HorizontalAlign="Center" />
                                        <ItemTemplate>
                                            <ImageButton:View runat="server" ID="btnUpdate" ToolTip="Update this !" CommandName="edit" ImageUrl="/Administrator/Resource/Images/Table/filesave.png" />
                                        </ItemTemplate>
                                    </asp:TemplateColumn>
                                </Columns>
                                <HeaderStyle HorizontalAlign="Center" CssClass="postfooter" Height="27" Font-Bold="true" />
                                <ItemStyle HorizontalAlign="Center" CssClass="postheader" Height="22" />
                                <AlternatingItemStyle HorizontalAlign="Center" CssClass="post" Height="22" />
                            </asp:DataGrid>                            
                        </td>
                    </tr>
                    <tr>
                        <td class="postfooter" valign="middle" align="left">&nbsp;&nbsp;<asp:Button ID="btnUpdateAll" CssClass="pbutton" runat="server" Text="Cập nhật tất cả"
                                OnClick="btnUpdateAll_Click" />&nbsp;<asp:Label ID="lblUpdateStatus" runat="server"></asp:Label></td>
                    </tr>
                </table>
            </ContentTemplate>
            </asp:UpdatePanel>
        </td>
    </tr>
</table>
